
package com.sttk.fastMark.camera.adapter;

import android.graphics.Color;

import androidx.annotation.NonNull;

import com.chad.library.adapter.base.provider.BaseItemProvider;
import com.chad.library.adapter.base.viewholder.BaseViewHolder;
import com.sttk.fastMark.camera.R;
import com.sttk.fastMark.camera.basic.ProviderMultiAdapter;
import com.sttk.fastMark.camera.bean.CutBean;

public class CropAdapter extends ProviderMultiAdapter<CutBean> {

    public CropAdapter() {
        addItemProvider(new CropProvider());
    }

    private class CropProvider extends BaseItemProvider<CutBean> {
        @Override
        public int getItemViewType() {
            return ProviderMultiAdapter.TYPE_VIEW;
        }

        @Override
        public int getLayoutId() {
            return R.layout.item_crop;
        }

        @Override
        public void convert(@NonNull BaseViewHolder baseViewHolder, CutBean bean) {
            baseViewHolder.setText(R.id.tvCropItemName, bean.getName());
            if (bean.isSelect()) {
                baseViewHolder.setTextColor(R.id.tvCropItemName, Color.parseColor("#664DE8"));
            } else {
                baseViewHolder.setTextColor(R.id.tvCropItemName, Color.parseColor("#FFFFFF"));
            }
        }
    }
}
